package sg.edu.nus.iss.stockex;

import org.apache.hadoop.mapreduce.Partitioner;

public class CodeKeyPartitioner extends Partitioner<CodeDateKey, TimestampPriceDataPoint>{

	@Override
	public int getPartition(CodeDateKey key, TimestampPriceDataPoint value,
			int numPartitions) {
		return Math.abs(key.getCode().hashCode() * 127) % numPartitions;
	}

}
